package com.hdoit.kylin.web.proposal.modelconfig;

import com.hdoit.kylin.web.proposal.providers.DocumentProvider;
import com.hdoit.kylin.web.studentManager.providers.TeacherOwnProvider;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.PlaceholderAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class ProposalConfig extends ModelMetadataAttributeConfiguration{
public ProposalConfig(){
		
		this.setProperty("proposalName")
			.hasAttribute(new DisplayNameAttribute("报告名称"))
			.hasAttribute(new PlaceholderAttribute("请输入报告名"))
			.hasAttribute(new RequiredAttribute("报告名为必填项"));
		
		this.setProperty("tutorId")
			.hasAttribute(new DisplayNameAttribute("导师名称"))
			.hasAttribute(new DropDownListAttribute(new TeacherOwnProvider()))
			.hasAttribute(new RequiredAttribute("导师为必填项"));
	
		this.setProperty("comments")
			.hasAttribute(new PlaceholderAttribute("请输入报告简介"))
			.hasAttribute(new DisplayNameAttribute("报告简介"));
		
		this.setProperty("contents")
			.hasAttribute(new PlaceholderAttribute("请输入报告内容"))
			.hasAttribute(new DisplayNameAttribute("报告内容"))
			.hasAttribute(new RequiredAttribute("内容为必填项"));
		
		this.setProperty("version")
			.hasAttribute(new PlaceholderAttribute("请输入版本号"))
			.hasAttribute(new DisplayNameAttribute("版本号"))
			.hasAttribute(new RequiredAttribute("版本号为必填项"));
		
		this.setProperty("documentIds")
			.hasAttribute(new DisplayNameAttribute("引入文献"))
			.hasAttribute(new DropDownListAttribute(new DocumentProvider()));
	}
}
